|
WASTED Modding Documentation
1
ModdingDocumentation
|
The following global LUA functions can also be used in your mod scripts.
| Function | Description |
|---|---|
| DuplicateGameObject(GameObject source, string new_name) | Duplicates the GameObject source, and assigns it the name new_name. |
| CreateGameObject(string new_name) | Creates a new GameObject with the name new_name. |
| Color(float r, float g, float b) | Creates a Color with RGB values r, g, and b. |
| GetItem(string item_name) | Get an item by it's GameObject's name (not necessarily the same as the item's displayed name). |
| GetItems() | Gets a list of the items in the game. |
| GetItemsByType(string type_name) | Gets a list of the items in the game of type type_name (i.e. "Weapon"/"BaseArmor"/"BaseItem") |
| GetBuff(string buff_name) | Get a buff by it's GameObject's name (not necessarily the same as the buff's displayed name). |
| GetCondition(string condition_name) | Get a condition by it's GameObject's name (not necessarily the same as the condition's displayed name). |
| GetItemUsageRestriction | Load one of the built in ItemUsageRestriction prefabs. See example scripts to see how this is used. |
| GetShellEject(string name) | Load one of the built in Shell Eject prefabs. See example scripts to see how this is used. |
| GetWeaponClass(string name) | Load one of the built in Weapon Class prefabs. See example scripts to see how this is used. |
| GetWeaponRig(string name) | Load one of the built in Weapon Rig prefabs. See example scripts to see how this is used. |
| GetParticle(string name) | Load one of the built in Particle Effect prefabs. See example scripts to see how this is used. |
| GetSound(string name) | Load one of the built in sound effects. See example scripts to see how this is used. |
| GetVibrationTemplate(string name) | Load one of the built in Vibration Template prefabs. See example scripts to see how this is used. |
| Log(string text) | Print text out to the console. |
| LoadAssetFromBundle(string asset, string bundle) | Load the asset named asset from the specified asset bundle. The bundle must be located in the mod folder. |
| LoadTexture(string asset) | Load a texture named asset. The texture must be located in the mod folder. (It's recommended to load textures using the above LoadAssetFromBundle function rather than with LoadTexture.) |
| GetRadioPlaylist() | Gets a table filled with the songs that are played on the radio. |
| SetRadioPlaylist(List<AudioClip> | Sets the list of songs that are played on the radio. |
| SetGlobalExpression(string name, string expression) | Sets the global expression called name to expression. |